package com.frejoys.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.frejoys.dao.entity.UserCash;
import com.frejoys.dao.entity.UserCode;

public interface UserCodeService extends IService<UserCode> {
    default UserCode getOnly(QueryWrapper<UserCode> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    default UserCode getOnly(LambdaQueryWrapper<UserCode> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    //根据邀请码获取用户id
    Long codeByUserId(String code);


}
